package day06;
import java.util.Arrays;
import java.util.Scanner;
import com.sun.org.apache.bcel.internal.generic.ARETURN;

//方法
public class MethodDemo {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);

        int[] a=testArray(8,200);
        Arrays.sort(a);
        for(int i=0;i<a.length;i++){
            System.out.println(a[i]);
        }
        //speak();
        //say("蔡徐坤",24);
       // say("叶明洲",22);
        /*
        int a=(int)(Math.random()*1000);
        int b=(int)(Math.random()*1000);
        System.out.println(a);
        System.out.println(b);

         */
        /*
        System.out.println("请输入第一个数");
        int a=scan.nextInt();
        System.out.println("请输入第二个数");
        int b=scan.nextInt();


        int num=plus(a,b);//接收里面返回的数


        System.out.println("和为："+num);

       */
        aMethod();
        System.out.println(444);


    }
    public static void speak(){
        System.out.println("hello world!");
    }
    public static void say(String name,int age){
        if(age>50){
            return;//在特定条件下，提前结束方法
        }
        System.out.println("我叫"+name+"，我今年"+age+"岁了");
    }
    public static int plus(int a,int b){
        int sum=a+b;
        return sum;
    }

    public static int[] testArray(int length,int max){
        int[]arr=new int[length];
        for(int i=0;i<arr.length;i++){
            arr[i]=(int)(Math.random()*(max+1));
        }
         return arr;
    }
    public static void aMethod(){
        System.out.println(111);
        bMethod();
        System.out.println(222);
    }
    public static void bMethod(){
        System.out.println(333);
    }
}





